<template>
  <div class="app-container">
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="Plus"
          size="mini"
          @click="handleAdd"
          >新增</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="Delete"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          >修改</el-button
        >
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="Delete"
          size="mini"
          :disabled="single"
          @click="handleDelete"
          >删除</el-button
        >
      </el-col>
    </el-row>
    <el-table :data="tableData" style="width: 100%">
      <el-table-column type="selection" width="50" align="center" />
      <el-table-column
        prop="flowDefineCode"
        label="流程定义"
        align="center"
        width="180"
      />
      <el-table-column
        prop="flowNodeId"
        label="流程节点"
        align="center"
        width="180"
      />
      <el-table-column prop="assignType" label="指派类型" align="center" />
      <el-table-column prop="assignId" label="指派ID" align="center" />
      <el-table-column align="center">
        <template #default="scope">
          <el-button
            type="text"
            icon="Edit"
            @click="handleUpdate(scope.row)"
            >修改</el-button
          >
          <el-button
            type="text"
            icon="Delete"
            @click="handleDelete(scope.row)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script setup >
import { getFlowAssign } from "@/api/system/flow";
const tableData = ref([
  {
    date: "2016-05-03",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-02",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-04",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-01",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
]);
const route = useRoute();
const queryParams = ref({
  assignType: undefined,
  flowDefineCode: undefined,
  flowNodeId: undefined,
  order: "DESC",
  pageNum: 1,
  pageSize: 10,
  sortBy: "id",
});
function getList() {
  queryParams.value.flowDefineCode = route.params.flowDefineCode;
  getFlowAssign(queryParams.value).then((res) => {
    tableData.value = res.content;
  });
}
getList();
</script>
